package P3;

public class Peer
{	
	private String mAddress;
	private boolean mAnnounced;
	private boolean mCrawled;
	private boolean mIsUltrapeer;
	
	public Peer(String address, boolean isUltrapeer)
	{
		mAddress = address;
		mIsUltrapeer = isUltrapeer;
		mAnnounced = false;
		mCrawled = false;
	}
	
	@Override
	public boolean equals(Object other)
	{
		return ((Peer)other).mAddress.equals(mAddress);
	}
	
	public String GetAddress()
	{
		return mAddress;
	}
	
	// Have we told the coordinator about this peer?
	public boolean IsAnnounced()
	{
		return mAnnounced;
	}
	
	// Have we crawled this peer?
	public boolean IsCrawled()
	{
		return mCrawled;
	}
	
	// Is this peer an ultrapeer
	public boolean IsUltrapeer()
	{
		return mIsUltrapeer;
	}
}
